package com.dd.cloud.common.annotate.validation;

import com.dd.cloud.common.annotate.validation.impl.DescValidation;
import com.dd.cloud.common.constants.RegularConstants;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 验证个人简介、用法及注意事项、入库备注、角色描述、提现备注
 * @author admin
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = DescValidation.class)
public @interface Desc {

    boolean required() default true;

    String message() default "{begin}内容格式为不超过"+ RegularConstants.Verify.MAX_DESC +"位的数字和中文、英文（大小写）字符";

    /**
     * 提示的开头 即替换message {begin}的内容
     * @return
     */
    String begin() default "";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
